<?php
/**
 * 获取关键字接口
 */
defined('IN_PHPCMS') or exit('No permission resources.');
$number = intval($_GET['number']);
$title = $_POST['data'];
echo get_keywords($title, $number);

function get_keywords($data,$number) {
    if (!$data) {
        return '';
    }
    $phpanalysis = pc_base::load_sys_class('phpanalysis');
    $phpanalysis = new phpanalysis('utf-8', 'utf-8', false);
    $phpanalysis->LoadDict();
    $phpanalysis->SetSource($data);
    $phpanalysis->StartAnalysis(true);
    $new_data= $phpanalysis->GetFinallyKeywords($number);
    $return = trim(str_replace(',',' ',$new_data));
    return $return;
}
?>